package com.web;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.entity.Contact;
import com.service.ContactService;

public class EditContact extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String id=request.getParameter("id");
		
		ContactService contactService=new ContactService();
		Contact contact=contactService.getById(id);
		
		request.getSession().setAttribute("contact", contact);
		request.getRequestDispatcher("WEB-INF/views/editcontact.jsp").forward(request, response);
		
	}

}
